package com.shao.onlinepdf.controller;

import com.shao.onlinepdf.dto.Result;
import com.shao.onlinepdf.dto.auth.LoginRequest;
import com.shao.onlinepdf.dto.auth.LoginResponse;
import com.shao.onlinepdf.service.ITUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shaohuailin
 * @date 2021/11/19
 */
@RestController
@RequestMapping("/auth")
public class AuthController {

    @Autowired
    private ITUserService userService;

    @PostMapping("/login")
    public Result login(@RequestBody LoginRequest request) {
        LoginResponse response = userService.login(request);
        return Result.success(response);
    }
}
